package com.aaa.dao.impl;

import com.aaa.dao.CountDao;
import com.aaa.util.BaseDao;

import java.util.List;
import java.util.Map;

/**
 * @author ：Teacher陈
 * @date ：Created in 2020/10/31 15:31
 * @description：
 * @modified By：
 * @version:
 */
public class CountDaoImpl  extends BaseDao implements CountDao {
    @Override
    public List<Map<String, Object>> countByEmp() {
        String sql="SELECT\n" +
                "\tb.*,\n" +
                "\tu.user_name \n" +
                "FROM\n" +
                "\t( SELECT count( busin_id ) total, sum( transaction_price ) money, empnum FROM business GROUP BY empnum ) b\n" +
                "\tINNER JOIN tbl_user u ON b.empnum = u.user_id    ";
        List<Map<String, Object>> mapList = executeQuery(sql);
        return mapList;
    }
}
